# 定义进程状态常量
PROCESS_STOP = 0
PROCESS_BEGIN = 1
PROCESS_ING = 2
PROCESS_SUSPEND = 3


class ScrapyProcess:
    def __init__(self):
        # 初始化进程状态，默认为停止状态
        self.process_status = PROCESS_BEGIN

    def begin_process(self):
        """
        启动进程，将进程状态设置为开始状态
        """
        self.process_status = PROCESS_BEGIN

    def is_process_ing(self):
        """
        检查进程是否正在进行中
        :return: 返回True表示进程正在进行中，False表示进程不在进行中
        """
        return self.process_status == PROCESS_ING

    def stop_process(self):
        """
        停止进程，将进程状态设置为停止状态
        """
        self.process_status = PROCESS_STOP

    def suspend_process(self):
        """
        暂停进程，将进程状态设置为暂停状态
        """
        self.process_status = PROCESS_SUSPEND


if __name__ == '__main__':
    pass
